home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / mewn1m.zip / EMACS.RC < prev    next >
Text File  |  1993-03-30  |  3KB  |  114 lines

  1. ;    Example startup program for Micro-EMACS 3.11c for Windows
  2. ;
  3. ; Pierre Perret - October 1992
  4.  
  5. set $discmd FALSE
  6. write-message "[Setting up....]"
  7. set $flicker FALSE  ; uncomment to allow animated grinder cursor
  8.  
  9. store-procedure save-all-buffers
  10. ; This macro saves all the modified buffers to their respective
  11. ; files
  12.     set %tmp $cbufname
  13.     !while TRUE
  14.         !force save-file
  15.         !force next-buffer
  16.         !if &seq %tmp $cbufname
  17.             !return
  18.         !endif
  19.     !endwhile
  20. !endm
  21. macro-to-key save-all-buffers M-^Z  ; bind to ESC Ctrl+Z
  22.  
  23. !if &seq $sres "MSWIN"
  24. ; running under MS Windows
  25.  
  26. macro-to-menu save-all-buffers ">&File>Save a&ll@8"
  27.  
  28. ; setup some cool colors
  29.     add-mode lcyan          ; background
  30.     add-global-mode lcyan
  31.     add-mode BLUE           ; foreground
  32.     add-global-mode BLUE
  33.  
  34. ; resize the screen for 100 columns (not appropriate for pure VGA)
  35.     100  change-screen-width
  36.  
  37. ; this macro allows easy resizing of the current screen
  38.     store-procedure Set-Screen-Size
  39.         set %tmp @&cat &cat "Screen width (" $curwidth "): "
  40.         !if ¬ &sequal %tmp ""
  41.             set $curwidth %tmp
  42.         !endif
  43.         set %tmp @&cat &cat "Screen height (" $pagelen "): "
  44.         !if ¬ &sequal %tmp ""
  45.             set $pagelen %tmp
  46.         !endif
  47.     !endm
  48.  
  49. ; this macro allows easy setting of the fill column
  50.     store-procedure  Set-Fill-Column
  51.         set %tmp @&cat &cat "Fill column (" $fillcol "): "
  52.         !if ¬ &sequal %tmp ""
  53.             set $fillcol %tmp
  54.         !endif
  55.     !endm
  56.  
  57. ; get rid of some menu entries
  58. ; to replace them by a nicer macro that actually prompts the user
  59.     unbind-menu     ">S&creen>Si&ze>= &Width"
  60.     unbind-menu     "= &Height"
  61.     macro-to-menu   Set-Screen-Size "&Set:"
  62.     unbind-menu     ">&Edit>= &Fill column"
  63.     macro-to-menu   Set-Fill-Column "&Fill column:"
  64.  
  65. ; load Windows-specific macros
  66.     write-message "[Loading MDI macros...]"
  67.     execute-file "mdi.cmd"
  68.     write-message "[loading DEV macros...]"
  69.     execute-file "dev.cmd"
  70. !endif
  71. ; end of the MS-Windows stuff
  72.  
  73. !if &seq &left $version 4 "3.11"
  74.     write-message "[Loading CUA-feel macros...]"
  75.     execute-file "cua.cmd"
  76.     !if ¬ &seq &find "custom.cmd" ""
  77.         write-message "[loading CUSTOM macros...]
  78.         execute-file "custom.cmd"
  79.     !endif
  80.     write-message "[Still setting up...]"
  81. !endif
  82.  
  83. store-procedure    extension
  84. ; figure out the filename extension. returns lowercase result in %ext
  85. ; if no extension, returns ""
  86.     set %tmp &rig $cfname 4
  87.     set %ext &sin %tmp "."
  88.     !if &equ %ext 0
  89.         set %ext ""
  90.     !else
  91.         set %ext &low &mid %tmp &add %ext 1 3
  92.     !endif
  93. !endm
  94.  
  95. store-procedure readhook-proc
  96.     run extension
  97.     !if &sin "|c|h|cpp|hpp|dlg|def|rc|cmd|" &cat &cat "|" %ext "|"
  98.         add-mode cmode
  99.     !else
  100.         !if &sin "||me|1st|doc|txt|" &cat &cat "|" %ext "|"
  101.             add-mode wrap
  102.         !endif
  103.     !endif
  104. !endm
  105. set $readhook readhook-proc
  106.  
  107. set $ssave FALSE
  108. 4    handle-tab
  109. bind-to-key end-of-word M-F     ; I personally prefer this over next-word
  110. bind-to-key end-of-word FN^F
  111.  
  112. clear-message-line
  113. set $discmd TRUE
  114.